﻿ @model IEnumerable<PraceDyplomowe2.Models.UserProfile>

@{
    ViewBag.Title = "Lista studentów";
}

@section featured
{
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title">
                <h1>@ViewBag.Title.</h1>
            </hgroup>

        </div>
    </section>
}

<table>
    <tr>
        <th>
            @Html.DisplayName("Student")
        </th>
        <th>
            @Html.DisplayNameFor(model => model.KierunekStudiow)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ZapisanyNaTemat)
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink(item.Imie + " " + item.Nazwisko, "Details", "ProfilStudenta", new { id = item.UserId }, null)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.KierunekStudiow.Nazwa)
        </td>
        <td>
            @if (item.ZapisanyNaTemat == null)
            {
                @Html.Display("brak")
            }
            else
            {
                @Html.ActionLink(item.ZapisanyNaTemat.PolskiTytul, "Details", "Tematy", new { id = item.ZapisanyNaTemat.TematId }, null)
            }
        </td>
    </tr>
}

</table>
